package com.zy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
@TableName("orders")
//缴费凭据类
public class Order {
    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField("in_dateTime")
    private Date inDateTime;//入场时间

    @TableField("out_dateTime")
    private Date outDateTime;//离场时间
    private BigDecimal price;//缴费金额
    @TableField("isPayComplete")
    private boolean isPayComplete;//缴费完成状态  是否缴费

    @TableField("isRequireInvoicing")
    private boolean isRequireInvoicing;//是否开具发票


    private PricingStandard pricingStandard;//关联收费标准

    private ParkingLot parkingLot;//关联停车场

    private Vehicle vehicle;//关联车辆

    public Order(){
        this.inDateTime=this.outDateTime= new Date();
        this.isPayComplete=this.isRequireInvoicing=false;
        this.price= BigDecimal.ZERO;
    }
    public Order(Order entity) {
        this.id = entity.id;
        this.inDateTime = entity.inDateTime;
        this.outDateTime = entity.outDateTime;
        this.price = entity.price;
        this.isPayComplete = entity.isPayComplete;
        this.isRequireInvoicing = entity.isRequireInvoicing;
        this.pricingStandard = entity.pricingStandard;
        this.parkingLot = entity.parkingLot;
        this.vehicle = entity.vehicle;
    }
}


